<template>
	<view>
		<navbar :title="title" />
		<view class="mallDetails-card border-box mallDetails-content" v-if="content">
			<up-parse :content="content"></up-parse>
		</view>

	</view>
</template>

<script setup>
	import navbar from "@/components/navbar.vue"
	import getArticle from "@/sheep/api/promotion/article.js"
	import {
		ref
	} from "vue"
	import {
		onLoad,
	} from '@dcloudio/uni-app';

	const title = ref("");
	const content = ref("")
	const id = ref();

	const get = () => {
		getArticle.getArticle(id.value).then(res => {
			content.value = res.data.content
		})
	}

	onLoad((options) => {
		id.value = options.type
		if (+options.type === 3) {
			title.value = "隐私协议"
		} else {
			title.value = "用户协议"
		}
		get()
	})
</script>

<style>
	page {
		background: #F8F3E7;
	}

	.mallDetails-content {
		padding: 20rpx 20rpx 110rpx;
	}
</style>